
import java.util.Scanner;
class Rectangle1{
    int l;
    int h;

    Rectangle1(int l,int h){
        this.l = l;
        this.h = h;
    }

    public int getArea(){
        return l*h;
    }

    public int compareTo(Rectangle1 other){
        return this.getArea()-other.getArea();
    }

    public String toString() {
        return l+","+h;
    }
}
public class Main7 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Rectangle1 r1 = new Rectangle1(sc.nextInt(), sc.nextInt());// 输入长和宽
        Rectangle1 r2 = new Rectangle1(sc.nextInt(), sc.nextInt());// 输入长和宽

        if (r1.compareTo(r2) > 0) {
            Rectangle1 t = r1;
            r1 = r2;
            r2 = t;
        }
        System.out.println(r1 + "->" + r1.getArea());
        System.out.println(r2 + "->" + r2.getArea());

        sc.close();
    }
}

